package com.wyix;

import com.wyix.entity.Car;

/**
 * @author wangdx
 * @since 2025/8/1
 */
public class CarDealership {
    public static void main(String[] args) {
        // 创建普通汽车对象
        Car toyota = new Car("丰田", "凯美瑞", 199800, "白色", 2023);
        Car honda = new Car("本田", "雅阁", 209800, "黑色", 2023);

        // 调用对象方法
        toyota.startEngine();
        honda.drive();

        // 计算折扣价格
        double toyotaDiscountPrice = toyota.calculateDiscountedPrice(0.05);
        System.out.println(toyota.getBrand() + toyota.getModel() + "折扣后价格: " + toyotaDiscountPrice);

        // 打印对象信息
        System.out.println("展厅汽车信息:");
        System.out.println(toyota);
        System.out.println(honda);
    }
}